package com.nsoft.server.master.beans;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.nsoft.server.register.beans.BillingHeader;
import com.nsoft.server.register.beans.GcHeader;

@Entity
@Table(schema="master",name = "party_master")
public class PartyMaster implements Serializable {

	/*@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "partyNumId", column = @Column(name = "Party_num_id", nullable = false)),
			@AttributeOverride(name = "partyCharName", column = @Column(name = "Party_char_Name", nullable = false)),
			@AttributeOverride(name = "partyCharTan", column = @Column(name = "Party_char_TAN", nullable = false)),
			@AttributeOverride(name = "partyCharTin", column = @Column(name = "Party_char_TIN", nullable = false)),
			@AttributeOverride(name = "partyCharExim", column = @Column(name = "Party_char_exim", nullable = false)),
			@AttributeOverride(name = "partyCharPan", column = @Column(name = "Party_char_PAN", nullable = false)) })
	private PartyMasterPK pk;

	public Set<AccountMaster> getAccount() {
		return account;
	}

	public void setAccount(Set<AccountMaster> account) {
		this.account = account;
	}*/
	@Id
	@Column(name = "Party_num_id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int partyNumId;

	@Column(name = "Party_char_Name")
	private String partyCharName;

	@Column(name = "Party_char_TAN")
	private String partyCharTan;

	@Column(name = "Party_char_TIN")
	private String partyCharTin;

	@Column(name = "Party_char_exim")
	private String partyCharExim;

	@Column(name = "Party_char_PAN")
	private String partyCharPan;
	
	
	@OneToMany(mappedBy="party" )
	//@JoinColumns( { @JoinColumn(name = "partyNumId", referencedColumnName = "acc_num_partyId", insertable = false, updatable = false) })
	private Set<AccountMaster> account;
	
	
	public Set<BillingHeader> getBillSet() {
		return billSet;
	}

	public void setBillSet(Set<BillingHeader> billSet) {
		this.billSet = billSet;
	}

	@OneToMany(mappedBy="partyMaster")
	private Set<BillingHeader> billSet;
	
	
	

	public Set<GcHeader> getConsignorGC() {
		return consignorGC;
	}

	public void setConsignorGC(Set<GcHeader> consignorGC) {
		this.consignorGC = consignorGC;
	}

	public Set<GcHeader> getConsigneeGC() {
		return consigneeGC;
	}

	public void setConsigneeGC(Set<GcHeader> consigneeGC) {
		this.consigneeGC = consigneeGC;
	}

	public Set<GcHeader> getTransportGc() {
		return transportGc;
	}

	public void setTransportGc(Set<GcHeader> transportGc) {
		this.transportGc = transportGc;
	}

	@OneToMany(mappedBy="consignorPartyMaster")
	private Set<GcHeader>  consignorGC;
	

	@OneToMany(mappedBy="consigneePartyMaster")
	private Set<GcHeader>  consigneeGC;
	
	
	@OneToMany(mappedBy="transportPartyMaster")
	private Set<GcHeader> transportGc;
	
	

	public Set<VehicleMaster> getVehicle() {
		return vehicle;
	}

	public void setVehicle(Set<VehicleMaster> vehicle) {
		this.vehicle = vehicle;
	}

	@OneToMany(mappedBy="party" ,cascade = { CascadeType.ALL })
	//@JoinColumns( { @JoinColumn(name = "partyNumId", referencedColumnName = "vehNumBillingpartyid", insertable = false, updatable = false) })
	private Set<VehicleMaster> vehicle;

	@Column(name = "Party_char_Address")
	private String partyCharAddress;

	@Column(name = "Party_char_HomeAddress")
	private String partyCharHomeaddress;

	@Column(name = "Party_char_OPhone")
	private String partyCharOphone;

	@Column(name = "Party_char_Rphone")
	private String partyCharRphone;

	@Column(name = "Party_char_contactperson")
	private String partyCharContactperson;

	@Column(name = "Party_char_contactMobile")
	private String partyCharContactmobile;

	@Column(name = "Party_num_parentId")
	private int partyNumParentid;

	@Column(name = "Party_char_notes")
	private String partyCharNotes;

	@Column(name = "Party_date_created")
	private Date partyDateCreated;

	@Column(name = "Party_char_general1")
	private String partyCharGeneral1;

	@Column(name = "Party_char_general2")
	private String partyCharGeneral2;

	@Column(name = "Party_char_general3")
	private String partyCharGeneral3;

	@Column(name = "Party_char_general4")
	private String partyCharGeneral4;

	@Column(name = "Party_char_general5")
	private String partyCharGeneral5;

	/*
	 * @OneToMany(mappedBy = "Party_num_id") private Set<GcHeader>
	 * GCHeaderConsi;
	 */

	/*
	 * @OneToMany(mappedBy = "Party_num_id") private Set<GcHeader>
	 * GCHeaderConse;
	 * 
	 * public Set<GcHeader> getGCHeaderConsi() { return GCHeaderConsi; }
	 * 
	 * public void setGCHeaderConsi(Set<GcHeader> headerConsi) { GCHeaderConsi =
	 * headerConsi; }
	 * 
	 * public Set<GcHeader> getGCHeaderConse() { return GCHeaderConse; }
	 * 
	 * public void setGCHeaderConse(Set<GcHeader> headerConse) { GCHeaderConse =
	 * headerConse; }
	 */

	private static final long serialVersionUID = 1L;

	public PartyMaster() {
		super();
	}

	/*public PartyMasterPK getPk() {
		return this.pk;
	}

	public void setPk(PartyMasterPK pk) {
		this.pk = pk;
	}*/

	
	public int getPartyNumId() {
		return partyNumId;
	}

	public void setPartyNumId(int partyNumId) {
		this.partyNumId = partyNumId;
	}

	public String getPartyCharName() {
		return partyCharName;
	}

	public void setPartyCharName(String partyCharName) {
		this.partyCharName = partyCharName;
	}

	public String getPartyCharTan() {
		return partyCharTan;
	}

	public void setPartyCharTan(String partyCharTan) {
		this.partyCharTan = partyCharTan;
	}

	public String getPartyCharTin() {
		return partyCharTin;
	}

	public void setPartyCharTin(String partyCharTin) {
		this.partyCharTin = partyCharTin;
	}

	public String getPartyCharExim() {
		return partyCharExim;
	}

	public void setPartyCharExim(String partyCharExim) {
		this.partyCharExim = partyCharExim;
	}

	public String getPartyCharPan() {
		return partyCharPan;
	}

	public void setPartyCharPan(String partyCharPan) {
		this.partyCharPan = partyCharPan;
	}

	public Set<AccountMaster> getAccount() {
		return account;
	}

	public void setAccount(Set<AccountMaster> account) {
		this.account = account;
	}

	public String getPartyCharAddress() {
		return this.partyCharAddress;
	}

	public void setPartyCharAddress(String partyCharAddress) {
		this.partyCharAddress = partyCharAddress;
	}

	public String getPartyCharHomeaddress() {
		return this.partyCharHomeaddress;
	}

	public void setPartyCharHomeaddress(String partyCharHomeaddress) {
		this.partyCharHomeaddress = partyCharHomeaddress;
	}

	public String getPartyCharOphone() {
		return this.partyCharOphone;
	}

	public void setPartyCharOphone(String partyCharOphone) {
		this.partyCharOphone = partyCharOphone;
	}

	public String getPartyCharRphone() {
		return this.partyCharRphone;
	}

	public void setPartyCharRphone(String partyCharRphone) {
		this.partyCharRphone = partyCharRphone;
	}

	public String getPartyCharContactperson() {
		return this.partyCharContactperson;
	}

	public void setPartyCharContactperson(String partyCharContactperson) {
		this.partyCharContactperson = partyCharContactperson;
	}

	public String getPartyCharContactmobile() {
		return this.partyCharContactmobile;
	}

	public void setPartyCharContactmobile(String partyCharContactmobile) {
		this.partyCharContactmobile = partyCharContactmobile;
	}

	public int getPartyNumParentid() {
		return this.partyNumParentid;
	}

	public void setPartyNumParentid(int partyNumParentid) {
		this.partyNumParentid = partyNumParentid;
	}

	public String getPartyCharNotes() {
		return this.partyCharNotes;
	}

	public void setPartyCharNotes(String partyCharNotes) {
		this.partyCharNotes = partyCharNotes;
	}

	public Date getPartyDateCreated() {
		return this.partyDateCreated;
	}

	public void setPartyDateCreated(Date partyDateCreated) {
		this.partyDateCreated = partyDateCreated;
	}

	public String getPartyCharGeneral1() {
		return this.partyCharGeneral1;
	}

	public void setPartyCharGeneral1(String partyCharGeneral1) {
		this.partyCharGeneral1 = partyCharGeneral1;
	}

	public String getPartyCharGeneral2() {
		return this.partyCharGeneral2;
	}

	public void setPartyCharGeneral2(String partyCharGeneral2) {
		this.partyCharGeneral2 = partyCharGeneral2;
	}

	public String getPartyCharGeneral3() {
		return this.partyCharGeneral3;
	}

	public void setPartyCharGeneral3(String partyCharGeneral3) {
		this.partyCharGeneral3 = partyCharGeneral3;
	}

	public String getPartyCharGeneral4() {
		return this.partyCharGeneral4;
	}

	public void setPartyCharGeneral4(String partyCharGeneral4) {
		this.partyCharGeneral4 = partyCharGeneral4;
	}

	public String getPartyCharGeneral5() {
		return this.partyCharGeneral5;
	}

	public void setPartyCharGeneral5(String partyCharGeneral5) {
		this.partyCharGeneral5 = partyCharGeneral5;
	}

}
